import React from "react"
import { BrowserRouter as Router, Route, Switch } from "react-router-dom"
import Main from "../pages/main";
import Login from "../pages/login"
import Home from "../pages/home"
import UserList from "../pages/userList"

export default class Routes extends React.Component {
  constructor(props) {
    super(props);
    this.state = {}
  }

  render() {
    return (
      <Router>
        <Switch>
          {/* 登录 */}
          <Route path="/login" component={Login} />
          {/* <Route path="/createFile" component={Main} /> */}
          {/* home */}
          <Route path={"/home"}  render={() => (
            <Main>
              <Route path="/home" exact component={Home} />
              <Route path="/home/webFile" component={Home} />
              <Route path="/home/dbFile" component={UserList} />
            </Main>
          )} />
          {/* 默认进入登录 */}
          <Route path="/" component={Login} />
        </Switch>
      </Router>
    )
  }
}
